﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class Enterprise
    {
        //Код другий
        public int ID { get; set; }

        //Назва кода першого
        public string NameOrigin { get; set; }

        //Код перший
        public string CodeOrigin { get; set; }

        //Назва кода другого
        public string NameCode { get; set; }

        //Абревіатура
        public string Abreviation { get; set; }

        //Адрес
        public string Adress { get; set; }

        //Створені згідно документа
        public string AccorDocument { get; set; }

        public Dictionary<string, string> DocumentationFields { get; private set; }
        public Dictionary<string, string> AdressFields { get; private set; }
        public Dictionary<string, string> EnterpriseFields { get; private set; }


        Enterprise() { }
        Enterprise(string nameOrigin, string codeOrigin, string nameCode, string abreviation, string adress, string accorDocumentation)
            :this(0, nameOrigin, codeOrigin, nameOrigin, abreviation, adress, accorDocumentation){}
        Enterprise(int id, string nameOrigin, string codeOrigin, string nameCode, string abreviation, string adress, string accorDocumentation)
        {
            this.ID = id;
            this.NameOrigin = nameOrigin;
            this.CodeOrigin = codeOrigin;
            this.NameCode = nameCode;
            this.Abreviation = abreviation;
            this.Adress = adress;
            this.AccorDocument = accorDocumentation;

            DocumentationFields = new Dictionary<string, string>(1);
            DocumentationFields.Add("AccorDocument", AccorDocument);

            AdressFields = new Dictionary<string, string>(1);
            AdressFields.Add("Adress", Adress);

            EnterpriseFields = new Dictionary<string, string>(4);
            EnterpriseFields.Add("NameOrigin", NameOrigin);
            EnterpriseFields.Add("CodeOrigin", CodeOrigin);
            EnterpriseFields.Add("NameCode", NameCode);
            EnterpriseFields.Add("Abreviation", Abreviation);
        }
    }
}
